#ifndef SYSTEMMANAGER_H
#define SYSTEMMANAGER_H

#include <QMainWindow>
#include <QPushButton>
#include <QLabel>
#include <QDateEdit>
#include <QComboBox>
#include <QTableView>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QJsonArray>
#include <QFileDialog>
#include <QTextStream>
#include "logmodel.h"
#include "../MainProject/loggermanager.h"
#include "../MainProject/common.h"

namespace Ui {
class SystemManager;
}

class SystemManager : public QMainWindow
{
    Q_OBJECT

public:
    explicit SystemManager(QWidget *parent = nullptr);
    ~SystemManager();

private slots:
    void onQueryButtonClicked();
    void onExportButtonClicked();

    void on_settingsButton_clicked();

    void on_logBtn_clicked();

private:
    Ui::SystemManager *ui;

    QPushButton *settingsButton;
    QPushButton *queryButton;
    QPushButton *exportButton;
    QLabel *logsLabel;
    QLabel *scheduleLabel;
    QLabel *breadcrumbLabel;
    QLabel *timeLabel;
    QLabel *toLabel;
    QLabel *logTypeLabel;
    QDateEdit *startDateEdit;
    QDateEdit *endDateEdit;
    QComboBox *logTypeComboBox;
    QTableView *logsTableView;
    Common common;
    LogModel *logModel;

    void displayLogs(const QJsonArray& logs);
};

#endif // SYSTEMMANAGER_H
